package com.itcast.controller;

import com.itcast.entity.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author glh
 * @date 2019/9/3
 * @time 11:03
 */
@ControllerAdvice

public class BaseExceptionHandler {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result xxx(Exception e){
        return new Result(1,e.getMessage());
    }
}
